<template>
  <div id="header">
    <div class="container">
      <div class="header-left">
        <img src="../assets/images/icon.png" alt="" />
      </div>
      <div class="header-right">
        <ul>
          <router-link to="firstPage" active-class="active">
            <li class="button">首页</li>
          </router-link>
          <router-link to="gongneng" active-class="active">
            <li class="button">功能</li>
          </router-link>
          <li class="button1">
            <span class="anniu iconfont icon-diannao"></span>
            <span class="xiazai">下载电脑版</span>
          </li>
          <li class="button1" v-on="{ mouseleave: Leave }" @mouseenter="Enter">
            <span class="anniu iconfont icon-shouji"></span>
            <span class="xiazai">下载手机版</span>
          </li>
          <li>
            <div class="tubiao iconfont icon-bilibili-line"></div>
          </li>
          <li>
            <div
              class="tubiao iconfont icon-qq"
              v-on="{ mouseleave: myLeave }"
              @mouseenter="myEnter"
            ></div>
          </li>
          <li>
            <div class="tubiao iconfont icon-weibo1"></div>
          </li>
          <li>
            <div class="tubiao iconfont icon-share-tieba"></div>
          </li>
        </ul>
      </div>
      <div class="lianxi" v-if="isflag">
        <p>联系我们</p>
        <p>QQ群:791560075</p>
      </div>
      <div class="box" v-if="isShow">
        <div class="triangle"></div>
        <div class="bo-box">扫描下载元气壁纸手机版</div>
        <div class="top-box">
          <img src="../assets/images/erweima.png" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import "../assets/fonts/iconfont.css";
export default {
  name: "compHeader",
  data() {
    return {
      isShow: false,
      isflag: false,
    };
  },
  methods: {
    Enter() {
      this.isShow = true;
    },
    Leave() {
      this.isShow = false;
    },
    myEnter() {
      this.isflag = true;
    },
    myLeave() {
      this.isflag = false;
    },
  },
};
</script>

<style scoped lang="scss">
#header {
  width: 1200px;
  margin: 0 auto;
  .container {
    justify-content: space-between;
    height: 100px;
    position: relative;
    display: flex;
    width: 1200px;
    margin: 0 auto;
    .header-left {
      img {
        width: 200px;
        height: 100px;
      }
    }
    .header-right {
      line-height: 100px;
      ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
        position: relative;
        .active {
          color: #febc00;
        }
        a {
          text-decoration: none;
        }
        .button1 {
          width: 120px;
          height: 40px;
          border: 1px solid #febc00;
          text-align: center;
          line-height: 40px;
          margin-top: 31px;
          border-radius: 5px;
          .anniu {
            color: #febc00;
          }
          .xiazai {
            color: #febc00;
          }
        }
        .button1:hover {
          background-color: #febc00;
          .anniu {
            color: #ffffff;
          }
          .xiazai {
            color: #ffffff;
          }
        }
        li {
          margin-left: 10px;
          .iconfont {
            width: 50px;
            height: 50px;
          }
          .tubiao {
            border-radius: 50%;
            text-align: center;
            margin-top: 30px;
            line-height: 35px;
            width: 35px;
            height: 35px;
            font-size: 25px;
            color: #fff;
            background-color: #febc00;
            border: 1px solid #febc00;
          }
        }
        li:hover {
          .tubiao {
            color: #febc00;
            background-color: #fff;
            border: 1px solid #febc00;
          }
        }
        .button {
          line-height: 100px;
          font-size: 20px;
          margin-left: 20px;
          margin-right: 20px;
        }
      }
    }
    .lianxi {
      z-index: 1000;
      position: absolute;
      left: 1014px;
      top: 68px;
      text-align: center;
      width: 150px;
      height: 100px;
      background-color: #e9eaed;
      p {
        font-size: 16px;
      }
    }
    .box {
      z-index: 1000;
      width: 180px;
      height: 180px;
      background-color: #e9eaed;
      position: absolute;
      left: 867px;
      top: 92px;
      text-align: center;
      .top-box {
        img {
          width: 130px;
          height: 130px;
        }
      }
      .bo-box {
        line-height: 30px;
        font-size: 14px;
      }
      .triangle {
        position: absolute;
        left: 78px;
        top: -20px;
        width: 0;
        height: 0;
        border-top: 10px solid transparent;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 10px solid #e9eaed;
      }
    }
  }
}
</style>